1. Technical Field
The present invention relates in general to an improved data processing system and in particular to an improved method and system for addressing register files in a data processing unit. Still more particularly, the present invention relates to an improved method and system for addressing register files in an indirect addressing mode.
2. Description of the Related Art
Classic approaches to solving numeric problems frequently involve the use of indirect addressing to address a matrix or vector array. Such indirect addressing employs a pointer array containing pointers which are used to point to an element in the vector array currently being processed. This pointing or mapping elements from one array to another may be implemented in software by the following FORTRAN DO-loop: EQU DO 100 I=1 to N EQU 100X (I)=Y(K(I))
Where K is a table of pointers used to access the array Y. In the example above, a copy of the element in Y addressed by the ith element of K is placed into the ith element of array X.
Traditionally, this construct is implemented with all subject arrays located in main memory, which means that two memory accesses are necessary to indirectly access an element, while only a single memory access is necessary to directly access an element. In less expensive data processing system designs that support only a single access port to memory, system performance is compromised during an indirect memory access. To provide multiple, independent memory access ports to these less expensive data processing designs is very expensive. However, with multiple, independent memory access ports, the processor may initiate multiple, concurrent memory access requests, thus reducing the overall time required to execute the indirect memory access function. By incorporating multiple, independent memory access ports, maximum performance may be gained at extreme product costs. Without multiple, independent memory access ports, cost is reduced at the expense of performance.
The benefits of indirect addressing may be exploited in a number of application areas, such as sparse-matrix calculations, and dense vector multiplication. Other functions exploited by indirect addressing include population count (i.e., counting the number of one's in a word) and various character-based translations, such as translating ASCII to EBCDIC.
Thus the problem remaining in the prior art is to provide a method and system for indirectly addressing registers that avoids the performance degradation due to the need for two memory accesses, and avoids the expense of multiple, independent memory access ports.